Learning Objectives

Resources

Introduction

As a technical analyst in the GIS department, you want create to be able to access 311 service request data through a website or portal. You want users to be able to request the data by neighbourhood and have the results returned as a downloadable file using the Data Download service. This can be done through the use of Webhook URLs.

In this exercise, you’ll create a Webhook URL that runs a workspace. You’ll also learn how to modify values in the Webhook URL to edit workspace parameters.  

1) Open FME Workbench

Open starting workspace template (exercise-submit-job-through-webhook-url.fmwt) in FME Workbench (2024.1 or later)

Workspace

2) Run the Workspace and Inspect Data

Run the workspace then right-click on the 311Requests feature type to bring up the popup menu. Then click View Written Data... to open the dataset in Visual Preview. 

View Written Data

You’ll see all the open service requests. We should note what the data looks like so we will know where it has changed once we’ve updated the feature type in the webhook URL.

Visual Preview

3) Publish Workspace

Save the workspace as exercise-submit-job-through-webhook-url.fmwt and publish it to the Training repository in FME Flow. Make sure to check the Upload data files option. Register it with the Job Submitter and Data Download service.

Publish to Flow

4) Run on FME Flow

Click the Direct Link to the workspace in the Translation Log http://localhost/fmeserver/workspaces/run/Flow%20Authoring/exercise-submit-job-through-webhook-url.fmw and log in if necessary.

Select Training as the Repository and set the Service to Data Download. Leave the default values for Feature Types to Read

Run workspace

5) Create a webhook URL

Click on Workspace Actions and select Create Webhook.

Create webhook

6) Configure the webhook URL

Modify the default URL. Expand the Parameters panel. Try removing one of the values (e.g. “Downtown”) to see how it changes Webhook URL Preview in real-time.

Webhook Preview

Select Reset to restore Parameter default values and click OK.

7) Save the webhook

Before doing anything else, select the Download Webhook button to save the webhook information to your desktop. This file contains information about the new Webhook URL. It is the only opportunity we get to save its newly created token.

Save webhook

8) Submit a Job by Webhook URL

Open another browser window in incognito mode in order to test our new token. Paste the Authorization with Query String Webhook URL into the search bar and submit. You will receive a link to download a zip file containing the results as a GeoJSON file.

Download link containing GeoJSON

9) Inspect Data

Download and extract the zip file and open the 311-service-requests.geojson in FME Data Inspector to view the results

Download results

10)  Submit a Job by Webhook URL with Updated Parameters

Next to the query string’s FEATURE_TYPES parameter, delete all the values except “Downtown” (including the URL encoding). The result will look like this URL:

http://localhost/fmedatadownload/Training/exercise-submit-job-through-webhook-URL.fmw?FEATURE_TYPES=Downtown&opt_showresult=false&opt_servicemode=sync&token=<token>

Submit to receive a new download link. Inspect the new GeoJSON file in FME Data Inspector again. This time, the output GeoJSON is clipped only to the “Downtown” selection. 

Downtown results

11) View Jobs in FME Flow

In FME Flow, navigate to the Jobs > Completed page. Find the last submitted job by the workspace name and time of submission.

View Completed Jobs

Select the job to review the log. Expand REQUEST DATA to find the parameters.

Congratulations! You’ve now run a job, using multiple parameters, via Webhook URL.